import request from "../utils/request";

// 获取轮播数据列表
const getSwiperList = (queryInfo)=>{
    return request.get('/api/admin/slides',{params:{current:queryInfo.current}})
}

// 添加轮播数据

const addSwiper = (addForm)=>{
    return request.post('/api/admin/slides',{title:addForm.title,img:addForm.img,url:addForm.url,status:addForm.status})
}
// 修改轮播
const editSwiper = (id,addForm)=>{
    return request.put(`/api/admin/slides/${id}`,{title:addForm.title,img:addForm.img,url:addForm.url,status:addForm.status})
}

// 排序 

const swiperOrder = (id,seq)=>{
    return request.patch(`/api/admin/slides/${id}/seq`,{seq:seq})
}

const deleteSwiper = (id)=>{
    return request.delete(`/api/admin/slides/${id}`)
}

const operateStatus = (id)=>{
    return request.patch(`/api/admin/slides/${id}/status`)
}
// 获取轮播详情

const getSwiperDetail = (id)=>{
    return request.get(`/api/admin/slides/${id}`)
}
export {
    getSwiperList,
    addSwiper,
    editSwiper,
    swiperOrder,
    deleteSwiper,
    operateStatus,
    getSwiperDetail
    
}